In 2023, PayPal made a bold move unveiling their own ERC-20 token, PYUSD. A stablecoin currency that 1:1 pegs value to the US Dollar, the launch of PYUSD was an unprecedented move in both the crypto space and the traditional fintech world.
(If you’re wondering about pronunciation – rest assured we’ve heard insiders use both “Pay-USD”, “Pie-USD”, and PY-USD” -- so whatever works for you).
PYUSD is uniquely dual-sided. It is easily exchangeable to/from both PayPal and Venmo account balances, making it highly liquid in PayPal’s vast consumer and merchant networks. And it’s also a dollar-pegged ERC-20 token, fully interoperable with the wild emerging world of decentralized finance and onchain commerce.
Recognizing the potential of PYUSD, we saw an opportunity to demonstrate its use cases and potentially even help catalyze its adoption and growth. Though the token is yet to become a staple of crypto-based payments, we see its nascence as an opportunity to showcase emerging potential of new payment patterns in the evolving crypto ecosystem.
Enter… 🥁… PYUSD.pizza: onchain payment splitters that can be both paid from PayPal and Venmo accounts and split among PayPal and Venmo PYUSD receiving addresses!
PYUSD has the potential to leverage both the PayPal payments network and the Ethereum computational network to redefine the fabric of payments. PYUSD.pizza offers a preview of a world where fintech networks like PayPal act as conduits for crypto engagement for millions.
Under our informal incubator, The Garden, we cooked up a few fun projects. One of them was PYUSD.to, an open-source off-ramp to PayPal or Venmo wallets that also allows you to create personalized URLs for your PayPal / Venmo (or ETH) wallet addresses.
The next is PYUSD.pizza: an Ethereum protocol and web app for transparent and fair allocation of funds among multiple parties – including PayPal and Venmo recipients.
Early on, we decided that demonstrating the potential of PYUSD would require a fun and friendly experience doing something that’s possible in crypto but would be far more complex in traditional payment infra.
This is where PYUSD.pizza's splitter contracts, or "Pizzas", come in.
Consider this scenario: You and four friends have come together for a digital investment. Instead of dealing with the hassle of dividing profits manually, you all decide to create a 'Pizza' – a smart contract that always follows certain specific rules. Every time an investment brings profits, it's added into your Pizza, and whenever you're ready, a simple transaction ensures everyone gets their deserving share.
When you create a "Pizza", you are initiating a transaction to the PizzaFactory contract. The factory then creates a lightweight proxy of a pre-deployed Pizza implementation. This proxy contract address is your Pizza, which you can share with folks with either wallets or Venmo/PayPal accounts for them to send in PYUSD, ETH or other tokens.
When you're ready to distribute the funds that your Pizza has accumulated, you just need to send a transaction to the clone. This proxy then delegates to the underlying Pizza contract logic, checking the list of payees and their predefined portions and distributing the collected funds accordingly.
Splitters are actually a common protocol pattern, and PYUSD.pizza isn't the only splitter serving Ethereum. In fact at this point there are quite a few. So what makes PYUSD.pizza unique?
One differentiator is PYUSD.pizza is just simple. The smart contracts are brief with few configuration options, hold minimal state, and release to everyone simultaneously rather than offering the option of individual releases. Each pizza is also totally isolated, and doesn’t funnel funds all into a single main contract.
On the web app side, the tokens default to PYUSD (though it's not limited to it), it is simple to use with visuals of the portion split, and it integrates with PYUSD.to’s personalized URLs.
While we ultimately opted to demonstrate a standalone protocol, before building PYUSD.pizza we considered solving the splitter use case by writing a PYUSD-flavored frontend for Splits. If you're in search of a splitter protocol that is fully audited, much more sophisticated, and used by many projects and DAOs, you should look at Splits.
While we managed to cook up the above in limited time, what we are hoping to eventually offer are “gasless” Pizza splitters – usable even for accounts that don’t have native ETH to pay transaction fees.
Not requiring ETH to deploy a splitter was a feature that was a little out of scope for our initial project, but we felt was super important for the kinds of non-crypto people that PayPal can help onboard. That is why we made sure to make this possible in the protocol. We quietly added two features to the protocol (that we haven’t yet exposed in the app) to support this:
The Pizza contracts can be initialized with an optional bounty, which represents a percentage of the released value sent to the releaser (address of their choice).
For example, if a Pizza creator sets the bounty to 1%, and 1000 PYUSD are deposited on the Pizza, anyone who pays for the transaction to release those funds to the recipients can collect a 10 PYUSD bounty. The higher the bounty, the lower the balance needs to be for the bounty value to compensate for the transaction costs. And of course, there’s always the option for a normal, non-bounty release.
Pizza contract addresses can also be predicted (using the CREATE2 opcode) based on the unique combination of the payees, their shares, the bounty, and an arbitrary salt value. If you know all the parameters of your Pizza, you also know exactly what address it will be deployed to, so you can deposit funds before deploying.
When combined, we now have the ingredients for a totally gasless experience for PayPal users:
Create a splitter, but instead of deploying it, “save” it (like a take’n’bake).
The PYUSD.pizza app backend then records the saved parameters and the predicted address, and making it available programmatically.
Automated services monitor for transfers to the saved, undeployed pizza addresses.
From a PayPal or Venmo account, contributors can transfer to the given address.
When an undeployed pizza has sufficient balance(s) to make it profitable, anyone (bot or human) can deploy it and release the accumulated funds in order to collect the bounty.
While PYUSD.pizza is a nice little payment lego, it comes with its own set of caveats.
Once tokens or ETH are sent to any of these contracts, there's no possibility of reversion. Ensuring due diligence and caution is advised. It's crucial to understand that financial transactions with PYUSD.pizza are irreversible. PYUSD.pizza contracts do not have any owner or backdoors to rescue funds. This doesn't just mean freedom and decentralization, it also means self-accountability.
Though we’ve made reasonable efforts to ensure the security of the protocol, PYUSD.pizza has not been audited or reviewed by security researchers. It's a proof of concept aimed at showing the potential of PYUSD, and has so far only been tested with static analysis tools. Using the protocol may put your funds at risk in unanticipated ways.
Although PYUSD.pizza itself doesn't levy any fees, there are some potential costs. These include gas fees for the Ethereum network transactions and any "bounty" fee (disabled by default). The exact USD cost depends on the prevailing asset-to-USD exchange rate at the time.
PayPal doesn’t endorse this, and our collaboration with PayPal was limited to just a few high-level discussions. This was very much an exercise in taking what currently existed and independently building something around it.
This was a nice early exploration of the intersection of proven payment networks like PayPal and the open computational network of Ethereum.
It’s been a blast prototyping ideas like PYUSD.pizza and PYUSD.to to show what we can do with PYUSD – but this is not just about one-off open source projects. We want to find our community of builders and payment nerds interested in this space, and we’d love to hear from you!
If the massive potential of onchain commerce and payments resonates with you, please connect with Amanda at Garden Labs or Brent at Mono Koto. We’d love to hear what you’re working on and find ways to collaborate together.